<template>
  <div class="about">
    <h1 class="title">This is an about page</h1>
  </div>
</template>
<script>
import '../assets/jquery-1.8.3.min.js'
import '../assets/sockjs'
import '../assets/stomp'
export default{
	data(){
		return{
            deleteItem:{}
		}
	},
	created(){
		        let stompClient = null;
        connect(12);
        function connect(id) {
            let socket = new SockJS("https://szapi.chinawike.com/websocket");
            stompClient = Stomp.over(socket);
			console.log(stompClient)
            stompClient.connect({}, function(frame) {
                console.log('Connected: ' + frame);
                stompClient.subscribe('/topic/greetings'+id, function(greeting){
                    console.log(JSON.parse(greeting.body));
                });
            });
    }
	},
	mounted(){
				console.log($('h1.title').text())
		$('h1.title').css('background','#eee')

	},
    methods:{
        confirm(e){
            this.arr.splice(this.deleteItem.index,1);
        },
        deletes(item,index){
            this.show = !this.show;
            item.index = index;
            this.deleteItem = item
            // this.confirm(2)
        }
    }
}
</script>
